#include "mytest.h"
#include "ui_mytest.h"
#include <QDebug>

MyTest::MyTest(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MyTest)
{
    ui->setupUi(this);

//    b1 = new QPushButton(this);
//    b1->setText("第一区，顶部菜单栏");
//    b1->setFixedHeight(100); //设置固定高度
//    b1->setFixedWidth(200);  //设置固定宽度
//    b1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); //部件可以在垂直和水平方向上自动扩展以填充可用空间



}

MyTest::~MyTest()
{
    delete ui;
}


void MyTest::on_checkBox_stateChanged(int arg1)
{

    switch(arg1)
    {
        case Qt::Checked:
            ui->checkBox->setText("选中");
            break;
        case Qt::Unchecked:
            ui->checkBox->setText("未选中");
            break;
        case Qt::PartiallyChecked:
            ui->checkBox->setText("半选中");
            break;
    }

}



void MyTest::on_commandLinkButton_clicked()
{
    QDesktopServices::openUrl(QUrl("www.baidu.com"));
}


void MyTest::on_buttonBox_2_accepted()
{
    qDebug() << "haha";
}

void MyTest::on_buttonBox_2_rejected()
{
    qDebug() << "hehe";
}
